<template>
	<view class="Palace">
		<view class="palace-box" v-for="(item,index) in palacelist" :key="index" @click="tosearch(item.name)">
			<image class="palace-img" :src="`${item.img_url}`" mode=""></image>
			<text class="palace-text ft_color">{{item.name}}</text>
			<!-- 	<image class="palace-img" src="../../static/images/鞋子2.jpg" mode=""></image>
			<text class="palace-text ft_color">运动鞋</text> -->
		</view>
	</view>
</template>

<script>
	export default{
		props:{
			palacelist:Array
		},
		methods:{
			tosearch(name){
				uni.navigateTo({
					url:`/pages/toSearch/toSearch?item_name=${encodeURIComponent(name)}`
				})
			}
		}
	}
</script>

<style scoped>
	.Palace {
		display: flex;
		flex-wrap: wrap;
	}

	.palace-box {
		justify-content: center;
		width: 25%;
		flex-direction: column;
		text-align: center;
	}

	.palace-img {
		width: 140rpx;
		height: 140rpx;
		padding: 10rpx;
	}

	.palace-text {
		display: block;
	}
</style>